package cp3120.dao.remote;

import cp3120.dao.DAOFactory;
import cp3120.dao.FlightDAO;
import cp3120.dao.UserDAO;
import cp3120.dao.PurchaseDAO;
import cp3120.dao.VariableDAO;
import generic.net.client.Client;

/**
 *
 * @author Adam Scarr <scarr.adam@gmail.com>
 */
public class RemoteDAOFactory extends DAOFactory {
    private RemoteFlightDAO flightDAO;
    private RemoteUserDAO userDAO;
    private RemotePurchaseDAO purchaseDAO;
    private RemoteVariableDAO variableDAO;

    /**
     * creates a new RemoteDAOFactory and all the remote DAOs
     * @param client the client each Remote DAO will be connected too
     */
    public RemoteDAOFactory(Client client) {
        flightDAO = new RemoteFlightDAO(client);
        userDAO = new RemoteUserDAO(client);
        purchaseDAO = new RemotePurchaseDAO(client);
        variableDAO = new RemoteVariableDAO(client);
    }

    protected FlightDAO getFlightDAOImplementation() {
        return flightDAO;
    }

    protected UserDAO getUserDAOImplementation() {
        return userDAO;
    }

    /**
     * @return The DAO for purchases.
     */
    public PurchaseDAO getPurchaseDAOImplementation() {
        return purchaseDAO;
    }

    /**
     * @return The DAO for Varibles
     */
    protected VariableDAO getVariableDAOImplementation() {
        return variableDAO;
    }

}
